#include <copydir.h>
//进度条
void *putout_rate (void *arg){
	struct file_rate *filerate = (struct file_rate *)arg;
	double num = filerate->num;
	double sum = filerate->sum;
	double finish = (sum/num)*50;
	printf("\r");
	printf("复制文件中：[");
	for(int i = 0; i < 50; i++) {
		if(i < finish){
			usleep(5000);
			printf("=");
		} else {
			printf(" ");
		}
	}
	if(finish > 49.5)
		num = 50;
	printf("]%% %.2f",finish*2);
	fflush(stdout);
	FILE *f = fopen("./pro_copy.log","a+");
	time_t rawtime;
	struct tm *timeinfo;
	timeinfo = localtime(&rawtime);
	fprintf(f,"\007The current date/time is:%s\n",asctime(timeinfo));
	fprintf(f,"putout rate\n");
	fclose(f);
}
